

<template>
  <div class="car-run-count-wrap">
    <WiChart  :options="options"/>
  </div>
</template>
<script setup lang="ts">

import WiChart from "@/components/WiChart.vue";
import {chartOptionFun} from "./chartOption.js"
import {onMounted, ref} from "vue";
import {biApi} from "@/views/vms-bi/biApi";
const options = ref({})

const getData = ()=>{
  biApi.getDepartmentTop5().then((res:any[])=>{
    console.log(res)
    let data = []
    res &&  res.forEach(item=>{
      data.push({
        name:item.department_id,
        value:item.order_count
      })
    })
    options.value = chartOptionFun(data);
  })
}


onMounted(()=>{
  getData()
  // options.value = chartOptionFun();
})
</script>
<style scoped lang="scss">
.car-run-count-wrap{
  height: 100%;
  width: 100%;
}
</style>